<template>
	<view class="user_container">
		<homeMenu 
		:title="item.name" 
		:clicktype="item.clicktype"
		:url="item.url"
		v-for="item,index in list" 
		:key="index"/>
		<button type="primary" class="user_container__logout" @tap="logout">退出登录</button>
		
	</view>
</template>

<script setup>
	import homeMenu from '../../component/home/home-menu.vue';
	import {ref} from 'vue';
	import user from '../../common/user.js';
	
	const list = ref([
		{
			icon:"",
			name:"账户与安全",
			clicktype:"navigateTo",
			url:"/pages/user-set-repassword/user-set-repassword"
		},
		{
			icon:"",
			name:"绑定邮箱",
			clicktype:"navigateTo",
			url:"/pages/user-set-email/user-set-email"
		},
		{
			icon:"",
			name:"资料编辑",
			clicktype:"navigateTo",
			url:"/pages/user-set-userinfo/user-set-userinfo"
		},
		{
			icon:"",
			name:"小纸条"
		},
		{
			icon:"",
			name:"清除缓存"
		},	
		{
			icon:"",
			name:"意见反馈",
			clicktype:"navigateTo",
			url:"/pages/user-set-help/user-set-help"
		},	
		{
			icon:"",
			name:"关于百科",
			clicktype:"navigateTo",
			url:"/pages/usser-set-about/usser-set-about"
		},
	])

	function logout(e){
		user.token=false;
		uni.navigateBack()
	}
</script>

<style lang="scss" scoped>
.user_container {
	padding: 10upx 30upx 10upx 0;
	&__logout{
		width: 80%;
		background-color: #ffda26;
		color: black;
		border: none;
		margin: 20upx auto;
	}
}
</style>
